#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/1/28 20:23
# @Author  : devsuperjin
# @File    : casbin.py
"""
casbin 权限
"""

import casbin
# from casbin import util

from setting.web import settings


def get_casbin() -> casbin.Enforcer:
    #adapter = casbin_sqlalchemy_adapter.Adapter(engine)

    #TODO 将casbin的policy放入数据库中
    e = casbin.Enforcer(settings.CASBIN_MODEL_PATH, settings.CASBIN_POLICY_PATH)
    # e.add_function("ParamsMatch", params_match_func)
    return e
